GtkClipboardWayland: Fix memory leak
authorPavel Vasin <rat4vier@gmail.com>
Wed, 21 Aug 2013 10:59:45 +0000 (14:59 +0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 31 Aug 2013 16:28:19 +0000 (12:28 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=706493

gtk/gtkclipboard-wayland.c

index 925de30bf6b9b3ec6715d106170cfdc74b97cbc5..328ba4df417cc9b68a158914be3c17d5075b54bd 100644 (file)
@@ -278,6 +278,7 @@ gtk_clipboard_wayland_request_contents (GtkClipboard            *gtkclipboard,
   GdkDeviceManager *device_manager;
   GdkDevice *device;
   ClipboardRequestClosure *closure;
+  gchar *mime_type;
 
   device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
   device = gdk_device_manager_get_client_pointer (device_manager);
@@ -312,10 +313,14 @@ gtk_clipboard_wayland_request_contents (GtkClipboard            *gtkclipboard,
   closure->target = target;
 
   /* TODO: Do we need to check that target is valid ? */
+  mime_type = gdk_atom_name (target);
+
   gdk_wayland_device_request_selection_content (device,
-                                                gdk_atom_name (target),
+                                                mime_type,
                                                 _request_generic_cb,
                                                 closure);
+
+  g_free (mime_type);
 }
 
 static void